<template>
  <div class="page_body">
    <HomeTop :topTitle="topTitle"></HomeTop>
    <div class="order_body">
      <!-- 考生信息 -->
      <div class="content_card">
        <img
          class="content_card_icon"
          src="../../assets/image/success_icon01.png"
          alt="提示"
        />
        <div class="content_card_tips">{{ tipsContent }}</div>
        <div class="content_card_btn_box">
          <div class="content_card_btn" @click="toHomeFn()">确认</div>
        </div>
      </div>
    </div>
  </div>
</template>
<style src="../../assets/css/order/orderSuccess.css" scoped></style>

<script>
import HomeTop from "@/components/homeTop.vue";

export default {
  name: "OrderSuccess",
  components: {
    HomeTop,
  },
  data() {
    return {
      topTitle: "提示", // 顶部组件参数设置
      orderId: "", // 订单Id,
      orderType: "", // 订单类型,
      tipsContent: "", // 提示内容
      detailRouter: "", // 详情路由
      homeRouter: "", // 首页路由
    };
  },
  created: function () {
    let query = this.$route.query;
    if (query.orderId != undefined && query.orderId != "") {
      this.orderId = query.orderId;
    }
    if (query.source != undefined && query.source != "") {
      this.orderType = query.source;
    }

    if (this.orderType == "coachPay") {
      this.tipsContent = "支付成功";
      this.homeRouter = "CoachHome";
    }
    if (this.orderType == "refereePay") {
      this.tipsContent = "支付成功";
      this.homeRouter = "RefereeHome";
    }
    if (this.orderType == "refereeRegister") {
      this.tipsContent = "注册成功";
      this.homeRouter = "RefereeHome";
    }
    if (this.orderType == "refereeReregistration") {
      this.tipsContent = "注册成功";
      this.homeRouter = "RefereeHome";
    }
  },
  methods: {
    // 返回首页
    toHomeFn: function () {
      let that = this;
      this.$router.replace({
        name: that.homeRouter,
      });
    },
  },
};
</script>
